<?php

/**
 * DadosResponsavel form base class.
 *
 * @package    form
 * @subpackage dados_responsavel
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseDadosResponsavelForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_dados_responsavel'  => new sfWidgetFormInputHidden(),
      'id_endereco'           => new sfWidgetFormDoctrineChoice(array('model' => 'Endereco', 'add_empty' => true)),
      'nm_responsavel'        => new sfWidgetFormInput(),
      'ds_grau_parentesco'    => new sfWidgetFormInput(),
      'dt_nascimento'         => new sfWidgetFormDateTime(),
      'nu_identidade'         => new sfWidgetFormInput(),
      'ds_expedida_por'       => new sfWidgetFormInput(),
      'nu_cpf'                => new sfWidgetFormInput(),
      'nu_telefone'           => new sfWidgetFormInput(),
      'nu_telefone_comercial' => new sfWidgetFormInput(),
      'nu_telefone_celular'   => new sfWidgetFormInput(),
      'nm_profissao'          => new sfWidgetFormInput(),
      'nm_empresa'            => new sfWidgetFormInput(),
      'nm_cargo'              => new sfWidgetFormInput(),
      'vl_salario'            => new sfWidgetFormInput(),
      'created_at'            => new sfWidgetFormDateTime(),
      'updated_at'            => new sfWidgetFormDateTime(),
      'deleted'               => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_dados_responsavel'  => new sfValidatorDoctrineChoice(array('model' => 'DadosResponsavel', 'column' => 'id_dados_responsavel', 'required' => false)),
      'id_endereco'           => new sfValidatorDoctrineChoice(array('model' => 'Endereco', 'required' => false)),
      'nm_responsavel'        => new sfValidatorString(array('max_length' => 150)),
      'ds_grau_parentesco'    => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'dt_nascimento'         => new sfValidatorDateTime(array('required' => false)),
      'nu_identidade'         => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'ds_expedida_por'       => new sfValidatorString(array('max_length' => 6, 'required' => false)),
      'nu_cpf'                => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'nu_telefone'           => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_telefone_comercial' => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_telefone_celular'   => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nm_profissao'          => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nm_empresa'            => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nm_cargo'              => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'vl_salario'            => new sfValidatorNumber(array('required' => false)),
      'created_at'            => new sfValidatorDateTime(array('required' => false)),
      'updated_at'            => new sfValidatorDateTime(array('required' => false)),
      'deleted'               => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('dados_responsavel[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'DadosResponsavel';
  }

}
